package com.yanqu.road.server.cmd.wingroom;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.wingroom.WingRoomProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.wingroom.CrossWingRoomMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_WING_ROOM_CROSS_SEND_VISIT_REWARD, desc = "拜访结束，访客奖励发放")
public class CrossUserVisitRewardSendUploadCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        WingRoomProto.CrossUserVisitRewardSendUploadMsg uploadMsg = WingRoomProto.CrossUserVisitRewardSendUploadMsg.parseFrom(packet.getBytes());


        CrossWingRoomMgr.updatePatronsVisitReward(uploadMsg.getUserId(), uploadMsg.getEndTime(), uploadMsg.getReward(), uploadMsg.getHomeUser());

    }

    @Override
    public void sendData() {

    }
}
